import {request} from '@umijs/max';
import * as API from "@/services";


/** 主编精选 分页检索请求 */
export async function queryChiefSelecteds(params: API.ChiefSelectedPageQueryParams): Promise<API.RespPageResult<API.ChiefSelected>> {
  return request('/api/v1/chief-selected', {
    params,
  });
}

/** 主编精选 详情请求 */
export async function queryChiefSelected(bizId: API.EntityId): Promise<API.RespResult<API.ChiefSelected>> {
  return request(`/api/v1/chief-selected/${bizId}`);
}

/** 主编精选 创建请求 */
export async function createChiefSelected(entity: API.ChiefSelected_Create): Promise<API.RespResult<any>> {
  return request(`/api/v1/chief-selected`, {
    method: 'POST',
    data: entity,
  });
}

/** 主编精选 修改请求 */
export async function modifyChiefSelected(entity: API.ChiefSelected_Modify): Promise<API.RespResult<any>> {
  return request(`/api/v1/chief-selected/${entity.id}`, {
    method: 'PUT',
    data: entity,
  });
}

/** 主编精选 修改(部分)请求 */
export async function patchChiefSelected(entity: API.ChiefSelected_Patch): Promise<API.RespResult<any>> {
  return request(`/api/v1/chief-selected/${entity.id}`, {
    method: 'PATCH',
    data: entity,
  });
}

/** 主编精选 删除请求 */
export async function deleteChiefSelected(bizId: API.EntityId): Promise<API.RespResult<any>> {
  return request(`/api/v1/chief-selected/${bizId}`, {
    method: 'DELETE',
  });
}

export async function deleteChiefSelectedByArticleId(articleId: API.EntityId): Promise<API.RespResult<any>> {
  return request(`/api/v1/chief-selected/article/${articleId}`, {
    method: 'DELETE',
  });
}

/** 主编精选 批量删除请求 */
export async function deleteChiefSelecteds(bizIds: API.EntityId[]): Promise<API.RespResult<any>> {
  return request(`/api/v1/chief-selected`, {
    method: 'DELETE',
    data: {
      ids: bizIds,
    },
  });
}
